package com.zhaohanlin.start;

import org.junit.Test;

import java.math.BigDecimal;

/**
 * @author zhaohanlin
 */

public class TypeTest {
    @Test
    public void money() {
        int money = 100, money1 = 200;
        System.out.println(money);
        System.out.println(money1);
        byte munA = (100);
        System.out.println(munA);
        short munB = (10000);
        System.out.println(munB);
        int munC = (1000000);
        System.out.println(munC);
        long munD = (1000000000000L);
        int munE = (int) 1000000000000000L;
        System.out.println(munE);
    }

    @Test
    public void floatTpye() {
        System.out.println(5.00 - 3.20);
        System.out.println(new BigDecimal("59.74385").subtract(new BigDecimal("33.37064")));
        double numA = 7.899137585649671;
        System.out.println(numA);
        float numB = 8.57F;
        System.out.println(numB);
    }

    @Test
    public void charType() {
        char numA = 'a';
        System.out.println(numA);
        char numB = 71;
        System.out.println(numB);

    }

    @Test
    public void booleanType() {
        int numA = 100;
        long numB = numA;
        System.out.println(numA);
        System.out.println(numB);
        long numC = 300;
        int numD = (int) numC;
        System.out.println(numC);
        System.out.println(numD);

    }

    @Test
    public void typeConversion() {
        int numC = 100;
        double numE= numC;
        System.out.println(numC);
        System.out.println(numE);
        double numF=3.24;
        int numG=(int)numF;
        System.out.println(numF);
        System.out.println(numG);
        char word='a';
        double result=word;
        System.out.println(word);
        System.out.println(result);
        int contA=10;
        long contB=100L;
        int contC= (int)(contA+contB);
        System.out.println(contC);
        char koos='a';
        System.out.println(koos+10);




    }


}
